//游戏数据
class GameData {
    public static token:string;//用户登录ID";
    public static areaCode:string;//区域id
    public static reconnect:boolean = false;//是否重连    
    public static step:number = 0;//步骤
    public static lftid:string;//我的ID号
    public static ignore:string;//时间戳;

    public static isUpdateScore:boolean = true;//是否可以刷新玩家分数
    public static myUserData:any;//我的数据
    public static mySeatIndex:number;//我的座位号
    public static ownerIndex:number;//房主座位号
    public static bankerIndex;////庄家座位号
    public static lastCard;////最后一次出的牌
    public static userData:any;//玩家信息
    public static outPokerIndex:number;//当前出牌座位号
    public static isGameRunning:boolean = false;//游戏是否在运行
    public static isRoundGame:boolean = false;//是否在回合游戏中
    public static isRoomInfoUpdate:boolean = false;//房间信息是否已刷新
    
    //房间信息
    public static backurl:string;//回放返回链接
    public static roundNo:string="5b3a697b993d487a8b6c6a7e4f906a6a";//回放
    public static gameNo:string;//
    public static roomInfo:any;//房间信息
    public static roomNo:string;//房间号
    public static maxPlayerCount:number;//玩家人数	
	public static remainCount:number;///剩余的牌数量	
	public static payType:number;///支付类型，1为AA，2为房主支付
	public static turns:number;///剩余回合数
	public static totalTurns:number;////总回合数
	public static ruleType:number;///玩法：1一码全中；2两个码，3四个码，4六个码
    public static winPokerCode:Array<string> = ["guo","chi","peng","hu","gang","angang","gonggang", '', '', '', 'bu_card'];//赢牌代码（0过、1吃、2碰、3胡、4明杠、5暗杠、6公杠
    public static ruleTypeStr:Array<string> = ["一个码","两个码","三个码","六个码","八个码","七小对可胡"];
    public static jushuStr:Array<string> = ["8回合","16回合"];
    public static zhifuStr:Array<string> = ["AA支付","房主支付","群主支付"];
    public static roomConf:any;//创建房间数据
    public static transformSeatIndex:Array<number>;//转换过的座位列表

    //玩家头像位置
    public static playPic_location:Array<any>;
    public static chat_location:Array<any>;

    public static lastOutPoker: any
    public static tingle: boolean = false

    //查找当前存在的用户ID
	public static getUserSeatIndex(lookupseatIndex:number):number{
		var id:number;
		if(this.userData.length<1) return 0;
		for(var i:number=0;i<this.userData.length;i++){
			if(lookupseatIndex == this.userData[i].seatIndex){
				id = i;
                break;
			}
		}
		return id;
	}
    //座位排列（座位号，排列的内容列表）实现固定上下家正确位置
    public static  updatePoint(_point:number,_contentList:Array<any>):Array<any>{
        var lsArr:Array<any> = new Array();
        var lsLength:number = _contentList.length;            
        var lsPoint:number=0;
        var lsPoint2:number=(_contentList.length-1)-_point;
        
        for(var i=0;i<lsLength;i++){		
            if(i == _point){
                lsArr.push(_contentList[0]);//确定我的座位
            }else{
                if(i<_point){
                    lsPoint2 ++;
                    lsArr.push(_contentList[lsPoint2]);//确定我的上家座位
                }else{
                    lsPoint ++;
                    lsArr.push(_contentList[lsPoint]);//确定我的下家座位
                }
            }
        }
        return lsArr;
    }

    public static centeroutPokerCache: any = []
    // public static handPokerCache: any = []
}